<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/3/13 0013
  Time: 14:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录界面</title>
    <style type="text/css">
        #logo{
            width: 100%;
            height: 100px;
        }
        #logoname{
            text-align: left;
            border-left: solid 1px white;
            padding-left: 30px;
            margin-left: 30px;
            color: white;
            line-height: 15px;
            display: inline-block;
            vertical-align: middle;
            position: relative;
            left: 150px;
            bottom: 10px;
        }
        #total{
            margin: 0px auto;
            position: relative;
            border-color: #006CB2;
            font-size: 13px;
        }
        #bg{
            float: left;
            width: 100%;
        }
        .chinese{
            font-size: 20px;
        }
        .english{
            font-size: 12px;
        }
        #box{
            width: 100%;
        }
        #boxbg{
            background: rgba(0,0,0,0.5);
            border-radius: 10px;
            width: 400px;
            color: white;
            margin: 0 auto;
            padding: 20px;
            position: relative;
            top: 50px;
        }
        form{
            padding: 0px;
            margin: 0px;
        }

        .submit {
            background-color: #0c86f3 !important;
            line-height: 35px;
            width: 85%;
            color: #ffffff !important;
            border: 0px;
        }
        .browser{
            color: darkgrey;
            font-size: 16px;
            position: relative;
            right: 30px;
        }
        a{
            color: white;
            text-decoration: none;
        }
        .bottom{
            width: 100%;
            height: 80px;
            line-height: 80px;
            color: #ffffff;
            text-align: center;
            position: fixed;
            bottom: 0px;
            height: 100px;
            line-height: 100px;
        }
        .login {
            text-align: center;
            font-size: 20px;
        }
        #duoxuan{
            position: relative;
            top: 40px;
            left: 10px;
        }
        #username{
            line-height: 35px;
            width: 85%;
        }
        #pwd{
            line-height: 35px;
            width: 85%;
        }
        .fogot{
            position: relative;
            right: 142px;
        }
        #zhongwen{
            position: relative;
            right: 90px;
            font-size: 13px;
        }
        body {
            font-size: 10px;
            font-family: 微软雅黑;
            position: relative;
            min-width: 1260px;
            background: url(img/back.png) center top / cover no-repeat;
        }
        .logo{
            position: relative;
            left: 150px;
            top: 40px;
        }
        .wang{
            font-size: 16px;
        }
    </style>
</head>

<body>


<div id="total">
    <div id="bg">
        <div id="logo">
            <img src="img/logo.png" class="logo">
            <div id="logoname">
                <span class="chinese">教学管理信息系统</span>
                <span class="english">Course Management Information System</span>
            </div>
        </div>
        <div id="box">
            <div id="boxbg">
                <form class="login" name="forml" method="post" action="/stu.do">

                                <span>账号登录</span><br><br>


                                <input type="text" name="user" id="username" tabindex="1" placeholder="学号/工号">
                    <br><br>


                                <input type="password"  name="password"  tabindex="2" id="pwd" placeholder="密码">
                    <br><br>
                                <input type="checkbox" class="zhongwen"> <span class="zhongwen">中文</span>  &nbsp; &nbsp; &nbsp;
                                <input type="checkbox"> <span class="zhongwen">English</span> &nbsp; &nbsp;
                                <input type="checkbox" name="flag" value="1" id="rad" > <span class="zhongwen">记住密码</span>
                    <br><br>
                                <input type="submit" value="登录" class="submit">
                    <br><br>
                        <span class="browser">
                                建议浏览器 &nbsp; &nbsp; <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads">IE9+</a>
                                &nbsp; &nbsp; <a href="http://www.firefox.com.cn/download/">firefox</a>
                                &nbsp; &nbsp; <a href="https://www.google.cn/intl/zh-CN/chrome/">Chrome</a>
                            </span>
                    <br>
                                <a href="http://www.baidu.com" class="fogot"> <span class="wang">忘记密码?</span></a>

                </form>
            </div>
            <div class="bottom">
                Copyright © 2018 上海树维信息科技有限公司
            </div>
        </div>
    </div>
</div>
<%
    Cookie[]ck=request.getCookies();
    boolean flag=false;
    String name="";
    String pwd="";
    if(ck!=null){
        for(int i=0;i<ck.length;i++){
            if(ck[i].getName().equals("name")){
                name=ck[i].getValue();
                flag=true;
            }else if(ck[i].getName().equals("pwd")){
                pwd=ck[i].getValue();
            }
        }
    }
%>
<script type="text/javascript">

   /* if(!--<%=flag%>){
        alert("您的cookie已经失效，请重新填写账户密码！")
    }*/
    var username=document.getElementById("username");
    var pwd=document.getElementById("pwd");
    username.value="<%=name%>";
    pwd.value="<%=pwd%>";
    if(username.value=="admin"&&pwd.value=="123456"){
        var rad=document.getElementById("rad");
        rad.setAttribute("checked","checked")
    }
</script>
</body>
</html>
